package com.cloud.pole.user.model.entity.account;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import org.hibernate.validator.constraints.NotEmpty;

/**
 * @author 
 */
@Table(name="user_account_detail")
public class UserAccountDetail implements Serializable {
    /**
     * detail_id
     */
    @Id
    private Long detailId;

    /**
     * 账目ID
     */
    @NotEmpty
    private Long accountId;

    /**
     * 账目类型ID
     */
    @NotEmpty
    private Integer typeId;

    /**
     * 用户id
     */
    @NotEmpty
    private Long userId;

    /**
     * 用户名
     */
    @NotEmpty
    private String userName;

    /**
     * 对象id
     */
    private String objectId;

    /**
     * 对象类型
     */
    private Integer objectTypeId;

    /**
     * 对象说明
     */
    private String objectNote;

    /**
     * 金额(单位分)
     */
    @NotEmpty
    private BigDecimal amount;

    /**
     * 更新前金额
     */
    private BigDecimal beforeAmount;

    /**
     * 更新后金额
     */
    private BigDecimal afterAmount;

    /**
     * 时间
     */
    private Date createTime;

    /**
     * 说明
     */
    private String note;

    /**
     * 源客户id
     */
    private Long srcUserId;

    /**
     * 源客户帐号
     */
    private String srcUserName;

    /**
     * 源客户姓名
     */
    private String srcRealName;

    private static final long serialVersionUID = 1L;

    public Long getDetailId() {
        return detailId;
    }

    public void setDetailId(Long detailId) {
        this.detailId = detailId;
    }

    public Long getAccountId() {
        return accountId;
    }

    public void setAccountId(Long accountId) {
        this.accountId = accountId;
    }

    public Integer getTypeId() {
        return typeId;
    }

    public void setTypeId(Integer typeId) {
        this.typeId = typeId;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getObjectId() {
        return objectId;
    }

    public void setObjectId(String objectId) {
        this.objectId = objectId;
    }

    public Integer getObjectTypeId() {
        return objectTypeId;
    }

    public void setObjectTypeId(Integer objectTypeId) {
        this.objectTypeId = objectTypeId;
    }

    public String getObjectNote() {
        return objectNote;
    }

    public void setObjectNote(String objectNote) {
        this.objectNote = objectNote;
    }

    public BigDecimal getAmount() {
        return amount;
    }

    public void setAmount(BigDecimal amount) {
        this.amount = amount;
    }

    public BigDecimal getBeforeAmount() {
        return beforeAmount;
    }

    public void setBeforeAmount(BigDecimal beforeAmount) {
        this.beforeAmount = beforeAmount;
    }

    public BigDecimal getAfterAmount() {
        return afterAmount;
    }

    public void setAfterAmount(BigDecimal afterAmount) {
        this.afterAmount = afterAmount;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getNote() {
        return note;
    }

    public void setNote(String note) {
        this.note = note;
    }

    public Long getSrcUserId() {
        return srcUserId;
    }

    public void setSrcUserId(Long srcUserId) {
        this.srcUserId = srcUserId;
    }

    public String getSrcUserName() {
        return srcUserName;
    }

    public void setSrcUserName(String srcUserName) {
        this.srcUserName = srcUserName;
    }

    public String getSrcRealName() {
        return srcRealName;
    }

    public void setSrcRealName(String srcRealName) {
        this.srcRealName = srcRealName;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        UserAccountDetail other = (UserAccountDetail) that;
        return (this.getDetailId() == null ? other.getDetailId() == null : this.getDetailId().equals(other.getDetailId()))
            && (this.getAccountId() == null ? other.getAccountId() == null : this.getAccountId().equals(other.getAccountId()))
            && (this.getTypeId() == null ? other.getTypeId() == null : this.getTypeId().equals(other.getTypeId()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getUserName() == null ? other.getUserName() == null : this.getUserName().equals(other.getUserName()))
            && (this.getObjectId() == null ? other.getObjectId() == null : this.getObjectId().equals(other.getObjectId()))
            && (this.getObjectTypeId() == null ? other.getObjectTypeId() == null : this.getObjectTypeId().equals(other.getObjectTypeId()))
            && (this.getObjectNote() == null ? other.getObjectNote() == null : this.getObjectNote().equals(other.getObjectNote()))
            && (this.getAmount() == null ? other.getAmount() == null : this.getAmount().equals(other.getAmount()))
            && (this.getBeforeAmount() == null ? other.getBeforeAmount() == null : this.getBeforeAmount().equals(other.getBeforeAmount()))
            && (this.getAfterAmount() == null ? other.getAfterAmount() == null : this.getAfterAmount().equals(other.getAfterAmount()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getNote() == null ? other.getNote() == null : this.getNote().equals(other.getNote()))
            && (this.getSrcUserId() == null ? other.getSrcUserId() == null : this.getSrcUserId().equals(other.getSrcUserId()))
            && (this.getSrcUserName() == null ? other.getSrcUserName() == null : this.getSrcUserName().equals(other.getSrcUserName()))
            && (this.getSrcRealName() == null ? other.getSrcRealName() == null : this.getSrcRealName().equals(other.getSrcRealName()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getDetailId() == null) ? 0 : getDetailId().hashCode());
        result = prime * result + ((getAccountId() == null) ? 0 : getAccountId().hashCode());
        result = prime * result + ((getTypeId() == null) ? 0 : getTypeId().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getUserName() == null) ? 0 : getUserName().hashCode());
        result = prime * result + ((getObjectId() == null) ? 0 : getObjectId().hashCode());
        result = prime * result + ((getObjectTypeId() == null) ? 0 : getObjectTypeId().hashCode());
        result = prime * result + ((getObjectNote() == null) ? 0 : getObjectNote().hashCode());
        result = prime * result + ((getAmount() == null) ? 0 : getAmount().hashCode());
        result = prime * result + ((getBeforeAmount() == null) ? 0 : getBeforeAmount().hashCode());
        result = prime * result + ((getAfterAmount() == null) ? 0 : getAfterAmount().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getNote() == null) ? 0 : getNote().hashCode());
        result = prime * result + ((getSrcUserId() == null) ? 0 : getSrcUserId().hashCode());
        result = prime * result + ((getSrcUserName() == null) ? 0 : getSrcUserName().hashCode());
        result = prime * result + ((getSrcRealName() == null) ? 0 : getSrcRealName().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", detailId=").append(detailId);
        sb.append(", accountId=").append(accountId);
        sb.append(", typeId=").append(typeId);
        sb.append(", userId=").append(userId);
        sb.append(", userName=").append(userName);
        sb.append(", objectId=").append(objectId);
        sb.append(", objectTypeId=").append(objectTypeId);
        sb.append(", objectNote=").append(objectNote);
        sb.append(", amount=").append(amount);
        sb.append(", beforeAmount=").append(beforeAmount);
        sb.append(", afterAmount=").append(afterAmount);
        sb.append(", createTime=").append(createTime);
        sb.append(", note=").append(note);
        sb.append(", srcUserId=").append(srcUserId);
        sb.append(", srcUserName=").append(srcUserName);
        sb.append(", srcRealName=").append(srcRealName);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}